/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AbstractGlobalParametersComponent.java
 *
 * Created on 15/Dez/2011, 19:12:58
 */

package intopo.game.gui;

import java.awt.Color;
import javax.swing.UIManager;

/**
 *
 * @author <a href="mailto:mariano.pedro@gmail.com">Pedro Mariano</a>
 *
 * @version 1.0 15/Dez/2011
 */
abstract public class AbstractGlobalParametersComponent
	extends javax.swing.JPanel
{

	/** Creates new form AbstractGlobalParametersComponent */
	protected AbstractGlobalParametersComponent ()
	{
		initComponents ();
	}
	/**
	 * Updates the colours of the text field component based on the given flag.
	 * @param textField The text field component to update.
	 * @param ok Ok flag.
	 */
	final protected void update (final javax.swing.JFormattedTextField textField, final boolean ok)
	{
		if (ok) {
			textField.setForeground (UIManager.getColor ("FormattedTextField.foreground"));
			textField.setBackground (UIManager.getColor ("FormattedTextField.background"));
		}
		else {
			textField.setForeground (Color.RED);
			textField.setBackground (Color.WHITE);
		}
	}

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
   // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
   private void initComponents() {

      javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
      this.setLayout(layout);
      layout.setHorizontalGroup(
         layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
         .addGap(0, 400, Short.MAX_VALUE)
      );
      layout.setVerticalGroup(
         layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
         .addGap(0, 300, Short.MAX_VALUE)
      );
   }// </editor-fold>//GEN-END:initComponents


   // Variables declaration - do not modify//GEN-BEGIN:variables
   // End of variables declaration//GEN-END:variables

}

// Local Variables:
// mode: java
// mode: flyspell-prog
// ispell-local-dictionary: "british"
// End:
